<?php $this->load->view('common/head');?>
<form class="form-inline" name="add" id="add" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post">
	<input type="hidden" name="id" id="id" value="<?=$supplementData['id']?>">
	<input type="hidden" name="year" id="year" value="<?=$supplementData['year']?>">
	<input type="hidden" name="timeUnit" id="timeUnit" value="<?=$supplementData['timeUnit']?>">
	<input type="hidden" name="type" id="type" value="<?=$supplementData['type']?>">
  <input type="hidden" name="fundType" id="fundType" value="<?=$supplementData['fundType']?>">
	<input type="hidden" name="storeId" id="storeId" value="<?=$supplementData['storeId']?>">
	<table class="table table-bordered">
		<thead>
			<tr>
        		<th class="bg-primary" colspan="2">基本信息</th>
        	</tr>
    	</thead>
    <tbody>
    	<tr>
    		<td class="col-md-1">专营店名称：</td>
    		<td align="left"><?php echo $storeData['storeName'] ?></td>
    	</tr>
    	<tr>
    		<td class="col-md-1">开放时间：</td>
    		<td align="left">
    			<div class="form-group">
    			<input type="text" class="form-control" style="width: 200px;" required onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'<?=($this->user['userRole'] == $this->userLib->roleArea) ? $minDate : ''?>',maxDate:'#F{$dp.$D(\'endTime\')<?=($this->user['userRole'] == $this->userLib->roleArea) ? "||\'".$maxDate."\'" : ''?>}'})" name="startTime" id="startTime" value="<?php echo $supplementData['startTimeStr'] ?>">
    			</div>
    		</td>
    	</tr>
    	<tr>
    		<td class="col-md-1">截止时间：</td>
    		<td align="left">
    			<div class="form-group">
    			<input type="text" class="form-control" style="width: 200px;" required onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'startTime\')<?=($this->user['userRole'] == $this->userLib->roleArea) ? "||\'".$minDate."\'" : ''?>}',maxDate:'<?=($this->user['userRole'] == $this->userLib->roleArea) ? $maxDate : ''?>'})" name="endTime" id="endTime" value="<?php echo $supplementData['endTimeStr'] ?>">
    			</div>
    		</td>
    	</tr>
    	<tr>
    		<td align="center" colspan="3">
    			<button type="submit" class="btn btn-default btn-primary">保存</button>
  				<button type="button" onclick="closeWindow()" class="btn btn-default btn-primary">取消</button>
    		</td>
    	</tr>
    </tbody>
    </table>
</form>
<script type="text/javascript">
	$(function(){
		$('[data-toggle="tooltip"]').tooltip();
		//Init Validation
  		initValidation();
	});
/**
 * 重启验证
 * @return {[type]} [description]
 */
function initValidation() {
  $('form[name="add"]').find("input,select,textarea").jqBootstrapValidation("destroy");
  $('form[name="add"]').find("input,select,textarea").not("[type=submit]").jqBootstrapValidation({
    preventSubmit:false,
    submitSuccess: function (form, event) {
         event.preventDefault();
         $("#selectedStoreList option").attr("selected", true);
         ajaxFormSubmit('add');
     },
     submitError: function (form, event, errors) {
       event.preventDefault();
     }
  });
}
</script>
<?php $this->load->view('common/foot');?>